<template>
	<view class="box">
		<view class="mine-box" v-for="(item,index) in list" :key="index">
			<view class="m-title">{{item.space_name}}</view>
			<view class="ti-bg ti-bg-1" :style="{'background-image':'url(' + $util.img('/static/img/card/z-copy.png') + ')'}">
				<view class="top">
					<view class="left">
						<text>累计</text>
						<image :src="$util.img('/static/img/card/bs.png')" mode="widthFix"></image>
						<text>{{item.total_output}}</text>
					</view>
					<view class="right" @click="open(item)">
						<text>{{item.num}}人正在挖矿</text>
						<u-icon name='arrow-right' size='26' style="margin-top: 2rpx;"></u-icon>
					</view>
				</view>
				<view class="t-item-box" :style="{
					
				}">
					<view class="txt">+{{item.output_m}}</view>
					<image class="image" :src="$util.img('/static/img/card/kuang.png')" mode="widthFix"></image>
				</view>
			</view>
			<view class="bottom">
				<view class="b-txt">每天能够挖出的</view>
				<image :src="$util.img('/static/img/card/bs.png')" mode="widthFix"></image>
				<view class="b-txt">产量 : {{item.output}}</view>
			</view>
		</view>
	</view>
	
</template>

<script>
	export default {
		props:{
			minelist:{
				type:[Object,Array],
				default:()=>{
					return []
				}
			}
		},
		data(){
			return {
				list:[]
			}
		},
		watch:{
			minelist:{
				handler(newval, oldVal) {
					this.list = this.minelist.map(item=>{
						let obj = {
							style:{

							},
							...item
						}
						return obj;
					});
				},
				immediate: true
			}
		},
		mounted() {},
		methods:{
			open(item){
				this.$emit('open',item)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.mine-box{
		margin-top: 30rpx;
		.m-title{
			color: #FFFFFF;
			font-size: 30rpx;
			font-weight: bold;
			margin: 0 30rpx 30rpx;
		}
		.ti-bg{
			position: relative;
			.top{
				display: flex;
				align-items: center;
				justify-content: space-between;
				.left{
					display: flex;
					align-items: center;
					font-size: 26rpx;
					color: #FFFFFF;
					image{
						width: 30rpx;
						margin:0 20rpx;
					}
				}
				.right{
					display: flex;
					align-items: center;
					font-size: 24rpx;
					color: #FFFFFF;
					text{
						margin-right: 10rpx;
					}
				}
			}
			
			.t-item-box{
				// position: absolute;
				// left: 30rpx;
				// bottom: 40rpx;
			display: flex;
			align-items: center;
			flex-direction: column;
			justify-content: center;
			
			image {
				width: 50rpx;
				animation: myfirst 2s linear infinite;
			}
				.txt{
					font-size: 26rpx;
					color: #FFFFFF;
					animation: ani 2s linear infinite;
				}
			}
			
		}
		.bottom{
			font-size: 26rpx;
			color: #FFFFFF;
			margin:0 30rpx;
			image{
				width: 30rpx;
				margin:0 20rpx;
			}
			display: flex;
			align-items: center;
		}
		
	}
	
	.ti-bg-1 {
		margin-top: 30rpx;
		padding: 32rpx 16rpx;
		box-sizing: border-box;
		position: relative;
		height: 300rpx;
		background: linear-gradient(90deg, #41A1F7 0%, #64D2F1 100%);
		border-radius: 20rpx;
		margin: 0 30rpx 30rpx;
		background-repeat: no-repeat;
		background-size: 100% 100%;
	}
	
	@keyframes myfirst {
		0% {
			transform:rotateX(0) ;
		}
		50%{
			transform:rotateX(40deg) ;
		}
		100% {
			transform:rotateX(0) ;
		}
	}
	@keyframes ani {
		0% {
			transform:translateY(0);
			opacity: 1;
		}
		100% {
			transform:translateY(-60rpx);
			opacity: 0;
		}
	}
</style>